{#include file="top.php"#}
<script type="text/javascript">
    function ajax_share_report_ponits(id, action_name, remark){
    $.ajax({
    url : '/ajax_points.php?action=ajax_fb_points',
            type : 'POST',
            data: "id=" + id + "&code={#php#}echo md5('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'imoreHK');{#/php#}&action_name=" + action_name + "&remark=" + remark,
            dataType : 'json',
            success: function(data){
    if (data.ret == 0){
    // console.info("未登入");
    } else if (data.ret == 1){
    if (data.data.ret == 1){
    // console.info(data.data.action);
    } else{
    //  console.info(data.data.reason);
    }

    } else{
    // console.info(data.reason);
    }
    }
    });
            var fb_count = 0;
            fb_count = parseInt($('#fb_count_' + id).html()) + 1;
            $('#fb_count_' + id).html(fb_count);
    }

    function apply(pid){
    $.getJSON("/product.php?action=ajax&t=11", {pid:pid}, function(data){
    if (parseInt(data.login) == 1){
    if (parseInt(data.email) == 1){
    if (parseInt(data.limit) == 1){
    if (parseInt(data.s) == 1 || parseInt(data.s) == 4 || parseInt(data.s) == 5){
    //showpop(data.msg);
    window.location.href = "{#optimize_url('product', 'report_add', 'mtype=1&pid='|cat:$pid)#}";
    } else if (parseInt(data.s) == 2 || parseInt(data.s) == 3){
    window.location.href = '/member_center.php?action=report';
    }
    } else{
    $("#popupText").html("你還未成為試用專員，<a href='/member.php?action=regTrial&toURL={#$thisUrl#}'>立即申請</a>！");
            showLB('#dialog_popup', 0);
    }
    } else{
    $("#popupText").html("您的電郵地址尚未驗證，請先激活！<a class='pink' href='/member.php?action=resendActivation' target='_blank'>重發激活郵件</a>");
            showLB('#dialog_popup', 0);
    }
    } else{
    $("#loginText").text("iTRIAL 會員登入 REGISTRATION");
            $("#login").attr("onClick", "login('apply(" + pid + ")')");
            $("#login_type").attr("onClick", "fnblogin('apply(" + pid + ")')");
            showLB('#dialog', 0);
    }
    });
    }

    function show_pro_grade(){
    $('#pro_grade_s').show();
            $('#age_dist_s').hide();
    }

    function show_age_dist(){
    $('#pro_grade_s').hide();
            $('#age_dist_s').show();
    }

    function plikes(sec, sid){
    $.getJSON("/product.php?action=ajax&t=3", {sec:sec, sid:sid}, function(data){
    if (parseInt(data.recode) == 1){
    $('#' + sec + '_likes_' + sid).html(data.likes);
    } else if (parseInt(data.recode) == 2){
    $("#loginText").text("以iMORE帳戶登入");
            $("#login").attr("onClick", "login('plikes(\\'" + sec + "\\'," + sid + ")')");
            $("#login_type").attr("onClick", "fnblogin('plikes(\\'" + sec + "\\'," + sid + ")')");
            showLB('#dialog', 0);
    } else{
    showpop(data.msg);
    }
    });
    }

    /* function fb_recommend(sec,sid){
     $.getJSON("/product.php?action=ajax&t=12",{sec:sec,sid:sid},function(data){
     if(parseInt(data.recode)==1){
     $('#fb_recommend').html(data.likes);
     }else if(parseInt(data.recode)==2){
     $("#loginText").text("以iMORE帳戶登入");
     $("#login").attr("onClick","login('fb_recommend(\\'"+sec+"\\',"+sid+")')");
     $("#login_type").attr("onClick","fnblogin('fb_recommend(\\'"+sec+"\\',"+sid+")')");
     showLB('#dialog',0);
     }else{
     showpop(data.msg);
     }
     });
     } */

    function login(func){

    var email = $('#email').val();
            if ($.trim(email).length == 0){
    $('#email_tip').show();
            $('#email').focus();
            return false;
    }
    var password = $('#password').val();
            if ($.trim(password).length == 0){
    $('#password_tip').show();
            $('#password').focus();
            return false;
    }
    /*
     var captcha = $('#captcha').val();
     if($.trim(captcha).length==0){
     alert("{#$ERR_CAPTCHA#}");
     $('#captcha').focus();
     return false;
     }
     */

    $.getJSON("/member.php?action=ajax_login_imore", {email:email, password:password/*,captcha:captcha*/}, function(data){
    if (parseInt(data.ret) == 1){
    showpop(data.msg);
    } else if (parseInt(data.ret) == 2){
    showpop(data.msg);
    } else{closeLB(); memberBar(); eval(func); }
    });
    }

    function login_fnb(func){
    var email = $('#email').val();
            if ($.trim(email).length == 0){
    $('#email_tip').show();
            $('#email').focus();
            return false;
    }
    var password = $('#password').val();
            if ($.trim(password).length == 0){
    $('#password_tip').show();
            $('#password').focus();
            return false;
    }
    /*
     var captcha = $('#captcha').val();
     if($.trim(captcha).length==0){
     alert("{#$ERR_CAPTCHA#}");
     $('#captcha').focus();
     return false;
     }
     */


    $.getJSON("/member.php?action=ajax_login_fnb", {email:email, password:password/*,captcha:captcha*/}, function(data){
    if (parseInt(data.ret) == 1){
    showpop(data.msg);
    } else if (parseInt(data.ret) == 2){
    showpop(data.msg);
    } else{closeLB(); memberBar(); eval(func); }
    });
    }

    function fnblogin(func){
    $("#loginText").text("F&amp;B 會員登入 REGISTRATION");
            $("#login").attr("onClick", "login_fnb(" + func + ")");
            $("#login_type_text").text("以 iMORE 登入");
            $("#login_type").attr("onClick", "itriallogin(" + func + ")");
            $("#loginTextName").css("background-position", "0 -940px");
            $("#classlogo").attr("class", "itrial ir");
    }
    function itriallogin(func){
    $("#loginText").text("iTRIAL 會員登入 REGISTRATION");
            $("#login").attr("onClick", "login(" + func + ")");
            $("#login_type_text").text("以 F&B 登入");
            $("#login_type").attr("onClick", "fnblogin(" + func + ")");
            $("#loginTextName").css("background-position", "0 -900px");
            $("#classlogo").attr("class", "fabtn ir");
    }


    function showLB(ct, n){
    var sh = $(document).height();
            var sw = $(document).width();
            var st = $(window).scrollTop();
            var ch = $(window).height();
            var cw = $(window).width();
            var tbT = (Number(ch) / 3 + Number(st)) + "px";
            var tbL = (Number(cw) / 2) + "px";
            if (n == 0){
    $("#fullbg").css({width:sw, height:sh});
            $(ct).css({top:tbT, left:tbL});
            $("#fullbg").fadeTo('slow', 0.4);
            $(ct).fadeIn('slow');
            $(window).scroll(function(){showLB(ct, 1)});
            $(window).resize(function(){showLB(ct, 1)});
    } else{
    if ($("#fullbg").css("display") == "block"){
    $("#fullbg").css({width:sw, height:sh});
            $(ct).css({top:tbT, left:tbL});
    }
    }
    }

    function closeLB(){
    $("#fullbg").fadeOut('slow');
            $('#dialog').fadeOut('slow');
            $("#dialog_popup").fadeOut('slow');
    }

    function user_like(uid){
    $.getJSON("/person.php?action=ajax&t=1", {uid:uid}, function(data){
    if (parseInt(data.recode) == 2){
    var l = parseInt($('#user_likes').html());
            $('.like_bt_' + uid).html("<a href='javascript:void(0);' class='btn_black' onclick='user_unlike(" + uid + ")'>取消關注</a>");
    } else if (parseInt(data.recode) == 1){
    $("#loginText").text("以iMORE帳戶登入");
            $("#login").attr("onClick", "login('user_like(" + uid + ")')");
            $("#login_type").attr("onClick", "fnblogin('user_like(" + uid + ")')");
            showLB('#dialog', 0);
    } else{
    showpop(data.msg);
    }
    });
    }

    function user_unlike(uid){
    $.getJSON("/person.php?action=ajax&t=2", {uid:uid}, function(data){
    if (parseInt(data.recode) == 2){
    var l = parseInt($('#user_likes').html());
            $('.like_bt_' + uid).html("<a href='javascript:void(0);' class='btn_pink' onclick='user_like(" + uid + ")'>關注</a>");
    } else if (parseInt(data.recode) == 1){
    $("#loginText").text("以iMORE帳戶登入");
            $("#login").attr("onClick", "login('user_unlike(" + uid + ")')");
            $("#login_type").attr("onClick", "fnblogin('user_unlike(" + uid + ")')");
            showLB('#dialog', 0);
    } else{
    showpop(data.msg);
    }
    });
    }

    function show_tabs(i){
        if(i==1){
            $('#tabs_b_2').removeClass('curr');
            $('#tabs_b_1').addClass('curr');
            $('#tab_1').show();
            $('#tab_2').hide();
        }else{
            $('#tabs_b_1').removeClass('curr');
            $('#tabs_b_2').addClass('curr');
            $('#tab_2').show();
            $('#tab_1').hide();
        }
    }

    $(function() {
    $('.img_lightbox').lightBox();
    });

</script>


<div class="body">
    <div class="main">
        <div class="crumb">
            <a href="{#optimize_url('product', 'invite_list', 'mtype=1')#}">試用專區</a> &gt;
            <a href="{#optimize_url('product', 'readReport_list', 'mtype=1')#}">試用報告</a> &gt;
            <strong>{#$product.type_name#} - {#$product.name#}</strong>
        </div>
        <div class="b_box b_box_t_rep">
            <div class="hd">
                <h2 class="hd_title">試用報告</h2>
            </div>
            <div class="bd">
                <figure class="img_box">
					<div class="img_box"><p class="img_p"><a class="img_lightbox" title="{#$product.cname#}" href="/{#$product.cover#}"><span><img src="{#$product._photo_url#}"></span></a></p></div>
                    {#if $product._overall#}
                    <div class="product_scroce">
                        <i class="scorce">{#$product._overall#}</i>
                        <span>分</span>
                    </div>
                    {#/if#}
                </figure>
                <h2 class="title_en">{#$product.type_name#} </h2>
                <h3 class="title_cn" style='margin-bottom:0px;'>{#$product.name#}</h3>
                <h3 class="title_cn">{#$product.cname#}</h3>
                <table>
                    {#foreach from=$product['_attr'] item=v key=k#}
                    <tr>
                        <th>{#$k#}</th>
                        <td class="td_m">：</td>
                        <td>{#$v#}</td>
                    </tr>
                    {#/foreach#}
                </table>
                {#if $product.is_report_add eq 1#}
                <a class="btn_s btn_s_report btn_s_emo" href="javascript:void(0);" onclick="apply({#$pid#})"><strong>發表心得</strong></a>
                {#else#}
                <a class="btn_no btn_s_report btn_s_emo"><strong>我要評鑑</strong></a>
                {#/if#}
                <a href="javascript:void(0);"   onclick="plikes('product', {#$pid#})" class="btn_like">
                    <span id='product_likes_{#$pid#}'>{#$product.likes#}</span> like
                    <em class="i">+1</em>
                </a>
            </div>
            {#if ($product.apply_starttime>('2000-01-01') && $product.report_endtime) && $t neq 1 && !empty($product.reports)#}
            <div class="ft">
                <span class="exp_span">試用期間 ：{#date('Y-m-d',strtotime($product.report_starttime))#} ~ {#date('Y-m-d',strtotime($product.report_endtime))#}</span>
                <span class="exp_span">試用日數 ：{#$product._diff_day#}日</span>
                <span>名額 ：{#$product['quota']#}個</span>
                {#if (!empty($product['capacity_trial']))#}<div><span class="exp_span">試用規格 ：{#$product['capacity_trial']#}</span></div>{#/if#}
            </div>

            {#/if#}
        </div>
        {#if !empty($product.reports)#}
        <div class="b_box b_box_t_mst b_box_t_mst_s b_box_t_mst_b">
            <div class="hd">
                <h2 class="hd_title">試用專員總評</h2>
            </div>
            <div class="bd">
                <div class="left_box">
                    <figure class="img_box">
						<div class="img_box"><p class="img_p"><span><img src="{#$product._pie_url#}"></span></p></div>
                    </figure>
                    <table>
                        <tr>
                            <td class="td1"><em class="co co1"></em></td>
                            <th class="td2">{#$product._well_score.0.cname#}</th>
                            <td class="td3">{#intval($product.product_reports_stat.well_score_num1)#}人</td>
                            <td>{#$product._well_score.num1#}</td>
                        </tr>
                        <tr>
                            <td class="td1"><em class="co co2"></em></td>
                            <th class="td2">{#$product._well_score.1.cname#}</th>
                            <td class="td3">{#intval($product.product_reports_stat.well_score_num2)#}人</td>
                            <td>{#$product._well_score.num2#}</td>
                        </tr>
                        <tr>
                            <td class="td1"><em class="co co3"></em></td>
                            <th class="td2">{#$product._well_score.2.cname#}</th>
                            <td class="td3">{#intval($product.product_reports_stat.well_score_num3)#}人</td>
                            <td>{#$product._well_score.num3#}</td>
                        </tr>
                        <tr>
                            <td class="td1"><em class="co co4"></em></td>
                            <th class="td2">{#$product._well_score.3.cname#}</th>
                            <td class="td3">{#intval($product.product_reports_stat.well_score_num4)#}人</td>
                            <td>{#$product._well_score.num4#}</td>
                        </tr>
                        <tr>
                            <td class="td1"><em class="co co5"></em></td>
                            <th class="td2">{#$product._well_score.4.cname#}</th>
                            <td class="td3">{#intval($product.product_reports_stat.well_score_num5)#}人</td>
                            <td>{#$product._well_score.num5#}</td>
                        </tr>
                    </table>
                    <div class="info">
                        <span class="name">試用報告</span> / <span class="num">{#$product.reports#}個</span>
                    </div>
                    <div class="intro">
                        <span><sup>好</sup>{#intval($product.product_reports_stat.good)#}</span>
                        <em>/</em>
                        <span><sup>一般</sup>{#intval($product.product_reports_stat.common)#}</span>
                        <em>/</em>
                        <span><sup>差</sup>{#intval($product.product_reports_stat.bad)#}</span>
                    </div>
                </div>
                <div class="t">
                    <a href='javascript:void(0);' onmouseover="show_pro_grade()">產品評分</a>
                    <a  href='javascript:void(0);'onmouseover="show_age_dist()">年齡分佈</a>
                </div>
                <div id='pro_grade_s' class="bar_box">
                    <table>
                        {#foreach from=$product['_vote_opt'] item=v key=k#}
                        <tr>
                            <th>{#$k#}</th>
                            <td>
                                <div class="bar">
                                    <em style="width:{#$v#}"></em>
                                </div>
                            </td>
                        </tr>
                        {#/foreach#}
                    </table>
                </div>
                <div id='age_dist_s' class="bar_box" style="display:none;">
                    <table>
                        {#foreach from=$product['_age_group'] item=v key=k#}
                        <tr>
                            <th>{#$k#}</th>
                            <td>
                                <div class="bar">
                                    <em style="width:{#$v#}"></em>
                                </div>
                            </td>
                        </tr>
                        {#/foreach#}
                    </table>
                </div>
            </div>
        </div>
        {#/if#}

        {#if !empty($fg_list)#}
        <div class="getpoint_box b_box">
            <div class="hd">
                <img src="/images/fg/fg_title_02.jpg" alt="" />
            </div>
            <div class="bd">
                <div class="chart_box">
                    <h2 class="char_title">總體滿意得分佔比</h2>
                    <div class="img_box"><img src='http://chart.apis.google.com/chart?cht=p&chd=t:{#$fg_list.item5apercent#},{#$fg_list.item4apercent#},{#$fg_list.item3apercent#},{#$fg_list.item2apercent#},{#$fg_list.item1apercent#}&chs=110x110&chco=cdbae1|a791bd|87719d|4c3662|311b47' /></div>
                    <table class="chart_tb" >
                        <tr>
                            <td><i class="pup pup_1"></i>很好</td>
                            <td>{#$fg_list.item1apercent#}%</td>
                            <td>{#$fg_list.item1amount#}票/{#$fg_list.item1grade#}分</td>
                        </tr>
                        <tr>
                            <td><i class="pup pup_2"></i>好</td>
                            <td>{#$fg_list.item2apercent#}%</td>
                            <td>{#$fg_list.item2amount#}票/{#$fg_list.item2grade#}分</td>
                        </tr>
                        <tr>
                            <td><i class="pup pup_3"></i>一般</td>
                            <td>{#$fg_list.item3apercent#}%</td>
                            <td>{#$fg_list.item3amount#}票/{#$fg_list.item3grade#}分</td>
                        </tr>
                        <tr>
                            <td><i class="pup pup_4"></i>差</td>
                            <td>{#$fg_list.item4apercent#}%</td>
                            <td>{#$fg_list.item4amount#}票/{#$fg_list.item4grade#}分</td>
                        </tr>
                        <tr>
                            <td><i class="pup pup_5"></i>很差</td>
                            <td>{#$fg_list.item5apercent#}%</td>
                            <td>{#$fg_list.item5amount#}票/{#$fg_list.item5grade#}分</td>
                        </tr>
                    </table>
                </div>
				{#if !empty($fg_reports.result)#}
                <div class="reference_box">
                    <h2 class="reference_title">FG網友商品特性使用參考</h2>
                    <table class="reference_tb">
                        {#foreach  from=$fg_list.vote_option_json item=v key=k#}
                        <tr>
                            <td class="title">{#$v.topicintro#}</td><td><img src="{#$v.topicstar#}"></td>
                        </tr>
                        {#/foreach#}
                    </table>
                </div>
				{#/if#}
                <div class="record_box">
                    <h2 class="record_title">市調報告紀錄表</h2>
                    <table class="record_tb">
                        <tr>
                            <td class="td_n td_1">市調期間</td><td  class="td_3">{#date('Y/m/d',strtotime($fg_list.resdates))#} ~ {#date('Y/m/d',strtotime($fg_list.resdatee))#}</td><td class="td_n td_2">市調商品測試人數</td><td>{#$fg_list.resamount#}人</td>
                        </tr>
                        <tr>
                            <td class="td_n td_l">測試週期</td><td class="td_3">{#$fg_list.resDuration#}</td><td class="td_n td_2">測試後投票人數</td><td>{#$fg_list.amount#}人</td>
                        </tr>
                        <tr>
                            <td class="td_n td_l">公佈日期</td><td class="td_3">{#date('Y / m / d',strtotime($fg_list.resShowDate))#}</td><td class="td_n td_2">回投率</td><td>{#$fg_list.backvote#}</td>
                        </tr>
                        <tr>
                            <td class="td_n td_l">市調條件</td><td class="td_3">{#$fg_list.resCondition#}</td>
                            <td class="td_n td_2">市調規格</td><td>{#$fg_list.resStandard#}</td>
                        </tr>
                    </table>
                    <i class="star_l">
                        <img src="/images/fg/star_l.png" alt="" />
                    </i>
                </div>
            </div>
        </div>
        {#/if#}

        {#if !empty($product.reports) || !empty($fg_reports.result)#}
            <div class="tab_b_box tab_b_box_w">
                {#if !empty($product.reports)#}<a {#if $tab neq 2#}class="curr"{#/if#} href="javascript:void(0);" onclick='show_tabs(1)' id='tabs_b_1'>試用專員評鑑</a>{#/if#}
                {#if !empty($fg_reports.result)#}<a {#if $tab neq 1 || empty($product.reports)#}class="curr"{#/if#} href="javascript:void(0);" onclick='show_tabs(2)' id='tabs_b_2'>FG市調大隊</a>{#/if#}
                <em class="line"></em>
            </div>
        {#/if#}

        {#if !empty($product.reports)#}
        <div id='tab_1' {#if $tab neq 1#}style='display:none'{#/if#}>
        {#foreach from=$reports_list['result'] item=v key=k#}
        <div class="b_box b_box_pro_rep b_box_pro_rep_ss {#if ($k+1) eq count($reports_list['result'])#}b_box_pro_rep_last{#/if#}">

            <div class="bd">
                <div class="box_hd">
                    <figure class="img_box">
                        <a href="{#optimize_url('person', 'report', 'username='|cat:$v.username)#}" ><img src="{#$v.photo_l#}" width=77 /></a>
                    </figure>
                    <h3 class="title"><a href="{#optimize_url('person', 'report', 'username='|cat:$v.username)#}">{#$v.username#}</a></h3>
                    <p>年齡：{#$agegroup_list['result'][intval($v.agegroup)-1]['cname']#}</p>
                    <p>臉部膚質：{#$v.body_skin#}</p>
                    <span class="like_bt_{#$v.mid#}">
                        {#if $v.islike==0#}
                        <a href="javascript:void(0);" class="btn_pink" onclick='user_like({#$v.mid#})'>關注</a>
                        {#else#}
                        <a href="javascript:void(0);" class="btn_black" onclick='user_unlike({#$v.mid#})'>取消關注</a>
                        {#/if#}
                    </span>
                    <em class="icon icon_master {#if $v.user_type neq 5#}icon_master_g{#/if#}">{#if $v.user_type neq 5#}試用專員{#else#}體驗達人{#/if#}</em>
                </div>
                <div class="box_mid">
                    <p>總評：{#if $v.well==1#}很好{#else if $v.well==2#}好{#else if $v.well==3#}一般{#else if $v.well==4#}差{#else if $v.well==5#}很差{#/if#}</p>
                    <div class="star_box">
                        <table>
                            <tr>
                                {#foreach  from=$reports_list._category_score.$k item=v1 key=k1#}
                                <th>{#$v1.v#}</th>
                                <td><strong class="star star_{#$v1.k#}">{#$v1.k#}星</strong></td>
                                {#if (($k1+1)%3) eq 0#}</tr><tr>{#/if#}
                                {#/foreach#}
                            </tr>
                        </table>
                        <br/>
                        <p class="que"><b><a class="que" href="{#optimize_url('product', 'reportDetail', 'mtype=1&pid='|cat:$pid|cat:'&rid='|cat:$v.id)#}">{#$v.title#}</a></b></p>
                        <div class="btn_box_r">

                            <a href="javascript:void(0);" onclick="plikes('report', {#$v.id#})" class="btn_pink">推介</a>
                            <span><a id='report_likes_{#$v.id#}'>{#$v.likes#}</a>個推介</span>
                            <div class="facebook_share">
                                <div class="count"><span class="count_button_nub">
                                    </span> <div  id="fb_count_{#$v.id#}">{#$v.fb_count#}</div></div>
                                <script>
            function postToFeed{#$v.id#}(id) {
    // calling the API ...
    var obj = {
    method: 'feed',
            link: '{#php#}echo DOMAIN;{#/php#}{#substr($v.share_url,1)#}',
            picture: '{#php#}echo DOMAIN;{#/php#}{#$product._photo_url#}',
            name: '{#str_replace("'","’",$v.title)#}',
            caption: '{#str_replace("'","’",$product.cname)#}',
            description: '{#str_replace("'","’",str_replace(array("\r\n", "\n", "\r"),"",strip_tags(htmlspecialchars_decode($v.body))))#}'
    };
            FB.ui(obj, function(response){
    if (response['post_id']){
    var remark = "{#str_replace("'","’",$v.title)#}"
            ajax_share_report_ponits(id, "share_report", remark);
    }
    });
    }</script>
                                <a class="btn_fb_share"
                                   title="Share on Facebook"
                                   onclick="postToFeed{#$v.id#}({#$v.id#});" href="javascript:void(0);"></a>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="box_bot">
                    <p><a href="{#optimize_url('product', 'reportDetail', 'mtype=1&pid='|cat:$pid|cat:'&rid='|cat:$v.id)#}">{#$v.body#}</a></p>
                    <ul class="clearfix">
                        {#foreach from=$reports_list._content.$k item=v1 key=k1#}
                        {#if $v1.p1 && $k1<4#}
                        <li {#if $k1 eq 3#}class="last"{#/if#}>
							<div class="img_box"><p class="img_p"><a href="{#optimize_url('product', 'reportDetail', 'mtype=1&pid='|cat:$pid|cat:'&rid='|cat:$v.id)#}"><span><img src="{#$v1.p1#}" alt="pic"></span></a></p></div>
                        </li>{#/if#}
                        {#/foreach#}
                    </ul>
                </div>
                <div class="msg">
                    <a href="javascript:void(0);">{#$v.comments#}篇留言</a> / <a href="{#optimize_url('product', 'reportDetail', 'mtype=1&pid='|cat:$pid|cat:'&rid='|cat:$v.id)#}" class="more_a">更多</a>
                </div>
            </div>
        </div>
        {#/foreach#}
        {#$pagelist#}
        </div>
        {#/if#}
        {#if $fg_reports.result#}
        <div id='tab_2' {#if $tab neq 2 && !empty($product.reports)#}style='display:none'{#/if#}>
        {#foreach from=$fg_reports.result item=v key=k#}
        <div class="b_box b_box_pro_rep">
            <div class="bd">
                <div class="box_hd">
					<figure class="img_box">
                        <img src="{#$v.msgavatar#}" width=77 />
                    </figure>
                    <h3 class="title">{#$v.msgname#}</h3>
                    <p>年齡：{#$v.msgage#}</p>
                    <p>臉部膚質：{#$v.msgskin#}</p>
					<br/>
                    <em class="icon icon_master icon_master_fg"> </em>
                </div>
                <div class="box_mid">
                    <p>總評：{#$v.msgitem#}</p>
                    <div class="star_box">
                        <table>
                            <tr>
                                {#foreach  from=$v.vote_option_json item=v1 key=k1#}
                                <th>{#$v1.msgintro#}</th>
                                <td><img src='{#$v1.msgstar#}'/></td>
                                {#if (($k1+1)%3) eq 0#}</tr><tr>{#/if#}
                                {#/foreach#}
                            </tr>
                        </table>
                        <br/>
                        <div class="btn_box_r">
                            <a href="javascript:void(0);" onclick="plikes('fg_report', {#$v.id#})" class="btn_pink">推介</a>
                            <span><a id='fg_report_likes_{#$v.id#}'>{#$v.likes#}</a>個推介</span>
                            <div class="facebook_share">
                                <div class="count"><span class="count_button_nub"></span>
                                    <div  id="fb_count_{#$v.id#}">{#$v.fb_count#}</div></div>
                                <script>
                                    function postToFeed{#$v.id#}(id) {
                                        // calling the API ...
                                        var obj = {
                                        method: 'feed',
                                                link: '{#php#}echo DOMAIN;{#/php#}{#substr($v.share_url,1)#}',
                                                picture: '{#php#}echo DOMAIN;{#/php#}{#$product._photo_url#}',
                                                name: '{#str_replace("'","’",$v.title)#}',
                                                caption: '{#str_replace("'","’",$product.cname)#}',
                                                description: '{#str_replace("'","’",str_replace(array("\r\n", "\n", "\r"),"",strip_tags(htmlspecialchars_decode($v.msg))))#}'
                                        };
                                                FB.ui(obj, function(response){
                                        if (response['post_id']){
                                        var remark = "{#str_replace("'","’",$v.title)#}"
                                                ajax_share_report_ponits(id, "share_report", remark);
                                        }
                                        });
                                        }
                                </script>
                                <a class="btn_fb_share"
                                   title="Share on Facebook"
                                   onclick="postToFeed{#$v.id#}({#$v.id#});" href="javascript:void(0);"></a>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="box_bot">
                    <p><a class="que" href="{#optimize_url('product', 'fg', 'mtype=1&pid='|cat:$pid|cat:'&rid='|cat:$v.id)#}">{#$v.msg#}</a></p>
                    <ul class="clearfix">
                        {#foreach from=$v.pic item=v1 key=k1#}
                        <li {#if $k1 eq 2#}class="last"{#/if#}>
							<div class="img_box"><p class="img_p"><a href="{#optimize_url('product', 'fg', 'mtype=1&pid='|cat:$pid|cat:'&rid='|cat:$v.id)#}"><span><img src="{#$v1#}" alt="pic"></span></a></p></div>
                        </li>
                        {#/foreach#}
                    </ul>
                </div>
                <a class="more" href="{#optimize_url('product', 'fg', 'mtype=1&pid='|cat:$pid|cat:'&rid='|cat:$v.id)#}" class="more_a">更多</a>
            </div>
        </div>
        {#/foreach#}
        {#$fg_pagelist#}
		<a href="{#$fg_list.topicurl#}" target="_blank" class="fg_btn btn_details_report middle"><strong>更详细的评鑑报告</strong></a>
        </div>
        {#/if#}
    </div>
    <!-- main-->
    <div class="sidebar">
        {#show_block('b2',1,'','sidebar_ad')#}
        {#show_block('b1',2,'','sidebar_function')#}
        {#show_block('b3',0,'','sidebar_search')#}
        {#show_block('b13',0,'','sidebar_registation')#}
        {#show_block('b11',0,'','sidebar_new_try sidebar_new b_box')#}
        {#show_block('b6',0,'','sidebar_facebook')#}
    </div>
    <!-- sidebar -->

</div><!--body-->

<!--  遮罩層  -->
<div id="fullbg" ></div>
<div  class="irpopbox popbox b_box" id="dialog" style="z-index: 60;	display:none;">
    <div class="hd">
        <h2 class="ir ht" id=loginTextName><span id=loginText>iTRIAL 會員登入 REGISTRATION</span></h2>
        <a class="popclose" style="cursor:pointer" onclick="closeLB();">close</a>
    </div>
    <div class="bd">
        <div class="lbox">
            <p>會員名稱 USERNAME</p>
            <input type="text" class="ipt" name="email" id="email">
            <p class="tip" id="email_tip" style="display:none;">
                <em class="hack"></em>
                <a class="close" href="javascript:void(0);" onclick="$('#email_tip').hide();">close</a>
                {#php#}echo NO_USERNAME;{#/php#}
            </p>
            <p>密碼 PASSWORD</p>
            <input type="password" class="ipt" name="password" id="password">
            <p class="tip" id="password_tip" style="display:none;">
                <em class="hack"></em>
                <a class="close" href="javascript:void(0);" onclick="$('#password_tip').hide();"> close </a>
                {#php#}echo NO_PASSWORD;{#/php#}
            </p>
            <a class="btn_s btn_s_login" onclick="login()" style="cursor:pointer" id="login"><strong>login</strong></a>
            <ul>
                <li><a href="/member.php?action=forgetPassword">忘記密碼</a></li>
                <li><a href="/member.php?action=reg&toURL={#$thisUrl#}">註冊新帳號</a></li>
            </ul>
        </div>
        <div class="rbox">
            <div class="lgbox"><em class="hack"></em>
                <a class="fbtn ir" href="/member.php?action=login_facebook&toURL={#$thisUrl#}"><strong>以facebook登入</strong></a><span><a class="fb_link" href="member.php?action=login_facebook&toURL={#$thisUrl#}">以facebook登入</a></span>
            </div>
            <div class="lgbox lgbox2" onClick="fnblogin()" id=login_type style="cursor:pointer" ><em class="hack"></em>
                <a class="fabtn ir" id=classlogo><strong>以F&amp;B登入</strong></a><span id=login_type_text  >以F&amp;B登入</span>
            </div>
        </div>
    </div>
</div>

<div style="top:400px;z-index:60;display:none;" class="apopbox popbox b_box" id="dialog_limits">
    <div class="hd">
        <h2 class="ir ht"><span>提示信息 ALERT</span></h2>
        <a class="popclose" onclick="closeLB();" style="cursor:pointer">close</a>            </div>
    <div class="bd">
        <p>你還未成為試用專員，<a href="/member.php?action=regTrial&toURL={#$thisUrl#}">立即申請</a>！</p>
        <a class="btn_b btn_s_im_back" href="javascript:void(0);" onclick="closeLB();"><strong>立即返回</strong></a>            </div>
</div>
<div style="top:400px;z-index:60;display:none;" class="apopbox popbox b_box" id="dialog_popup">
    <div class="hd">
        <h2 class="ir ht"><span>提示信息 ALERT</span></h2>
        <a class="popclose" onclick="closeLB();" style="cursor:pointer">close</a>            </div>
    <div class="bd">
        <p id="popupText"></p>
        <a class="btn_b btn_s_im_back" href="javascript:void(0);" onclick="closeLB();"><strong>立即返回</strong></a>            </div>
</div>
<script>
            function showpop(text){
            $("#fullbg").fadeIn();
                    $("#dialog").fadeOut('slow');
                    $("#dialog_limits").fadeOut('slow');
                    showLB('#dialog_popup', 0);
                    $("#popupText").text(text);
            }

    $(document).ready(function(){

    $('#email').mousedown(check_register_email);
            $('#email').keyup(check_register_email);
            $('#password').mousedown(check_register_password);
            $('#password').keyup(check_register_password);
    });
            function check_register_email(){
            var rt = 0;
                    if ($('#email').val().length == 0){
            $("#email_tip").addClass("tip").show();
            } else {
            $("#email_tip").removeClass("tip").hide();
                    rt = 1;
            }
            return rt;
            }
    function check_register_password(){
    var rt = 0;
            if ($('#email').val().length == 0){
    $("#email_tip").addClass("tip").show();
    } else {
    $("#email_tip").removeClass("tip").hide();
            rt = 1;
    }
    return rt;
    }

    function check_cssby(tipmainname){

    var obj = $("#" + tipmainname + "_tip");
            if (obj.attr('class') != 'tip'){
    return 1;
    } else{
    return 0;
    }
    }
    function check_register(){
    if ($('#email').val().length == 0){
    $('#email').focus();
            //alert("{#$NO_USERNAME#}");
            $('#email_tip').show();
            return false;
    } else if ($('#password').val().length == 0){
    $('#password').focus();
            //alert("{#$NO_PASSWORD#}");
            $('#password_tip').show();
            return false;
    } else{
    /*
     var captcha=$('#captcha').val();
     $.get("{#$selfurl#}?action=ajax_checkCaptcha",{captcha:captcha},function(data){
     if(data=='false'){
     alert("{#$ERR_CAPTCHA#}");
     $('#captcha').focus();
     $('#captcha_img').attr("src","captcha.php?t="+Math.random());
     return false;
     }else{
     $("#form1").submit();
     }
     });
     */
    $("#form1").submit();
    }
    }
    $(document).ready(function(){
    $('#email').focus();
    });
</script>
{#include file="footer.php"#}